package com.qf.oop.dt;

public class Circle extends Graphical{

    private int r; // 圆形的半径

    public Circle() {
    }

    public Circle(int r) {
        this.setName("圆形");
        this.r = r;
    }

    public int getR() {
        return r;
    }

    public void setR(int r) {
        this.r = r;
    }

    @Override
    public void printZC() {
        double v = 2 * 3.14 * r;
        System.out.println("圆形的周长为:"+v);
    }

    @Override
    public void printArea() {
        double v = 3.14 * r * r;
        System.out.println("圆形的面积为:"+v);
    }
}
